package com.framework.core.api.feign;

import com.framework.common.constant.ServiceNameConstants;
import com.framework.common.domain.R;
import com.framework.core.api.feign.factory.RemoteThirdUserFallbackFactory;
import com.framework.core.api.request.ThirdUserInfoReq;
import com.framework.core.api.response.ThirdUserInfoQueryRes;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author zhoubb
 * @version V1.0
 * @Date 2020/4/30 23:36
 * @since JDK 1.8
 */
@FeignClient(name = ServiceNameConstants.SERVICE_CORE,
        fallbackFactory = RemoteThirdUserFallbackFactory.class)
public interface RemoteThirdUserService {

    @PostMapping("thirdUser/registerThirdUser")
    public R registerThirdUser(ThirdUserInfoReq thirdUserInfoReq);

    @RequestMapping(value="thirdUser/getOrRegThirdUserInfoByOpenId", method=RequestMethod.POST)
    public ThirdUserInfoQueryRes getOrRegThirdUserInfoByOpenId(@RequestBody ThirdUserInfoReq thirdUserInfoReq);


    @RequestMapping(value="thirdUser/getThirdUserInfoByOpenId", method=RequestMethod.GET)
    public ThirdUserInfoQueryRes getThirdUserInfoByOpenId(@RequestParam(value = "openId") String openId);
}
